home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / demos / howtoskinacat / nynexcube / rotate-aga4.s < prev   
Text File  |  1980-01-03  |  39KB  |  1,868 lines

  1. ;------------------T--------T
  2. Track:    EQU    0
  3. Raster:    EQU    0
  4. A1200:    EQU    1
  5.  
  6.     IFEQ    A1200-1
  7. MatrixSize:    EQU    13
  8. ECS:    EQU    0
  9.     ELSE
  10. MatrixSize:    EQU    11
  11. ECS:    EQU    1
  12.     ENDC
  13.  
  14.  
  15. MyDmacon=%01111100000
  16. ;         abcdefghhhh
  17. ; a = Blitter nasty
  18. ; b = Enable DMA activity (always set this!)
  19. ; c = Bitplane enable
  20. ; d = Copper enable
  21. ; e = Blitter enable
  22. ; f = Sprite enable
  23. ; g = Disk enable
  24. ; h = Audio channels enable
  25.  
  26. MyIntena=%100000000100000
  27. ;         abcdeeeefghijkl
  28. ; a = Enable interrupts
  29. ; b = Lev. 6 External interrupt
  30. ; c = Lev. 5 Disk sync found
  31. ; d = Lev. 5 Serial port receive buffer full
  32. ; e = Lev. 4 Audio ch. 3-0 block finished
  33. ; f = Lev. 3 Blitter finished
  34. ; g = Lev. 3 Vertical blank
  35. ; h = Lev. 3 Copper
  36. ; i = Lev. 2 I/O Ports and timers
  37. ; j = Lev. 1 Software
  38. ; k = Lev. 1 Disk block finished
  39. ; l = Lev. 1 Serial port transmit buffer empty
  40.  
  41. *******************************************************************************
  42. **Macros
  43. *******************************************************************************
  44. WaitBlt:    MACRO
  45. .vent\@:    if    Raster=1
  46.     move.w    #$fff,Color00+_Custom
  47.     endif
  48.     btst    #14,Dmaconr+_Custom
  49.     bne.b    .vent\@
  50.     if    Raster=1
  51.     move.w    #0,Color00+_Custom
  52.     endif
  53.     ENDM
  54.  
  55. SetInt:    MACRO
  56.     move.l    (Lev\1Base).w,OldIrq\1
  57.     move.l    #Lev\1Irq,(Lev\1Base).w
  58.     bra.b    jumpo\@
  59. OldIrq\1:    dc.l    0
  60. jumpo\@:
  61.     ENDM
  62.  
  63. ClrInt:    MACRO
  64.     move.l    OldIrq\1(pc),(Lev\1Base).w
  65.     ENDM
  66.  
  67. Push.l:    MACRO
  68.     movem.l    \1,-(sp)
  69.     ENDM
  70.  
  71. Push.w:    MACRO
  72.     movem.w    \1,-(sp)
  73.     ENDM
  74.  
  75. Pull.l:    MACRO
  76.     movem.l    (sp)+,\1
  77.     ENDM
  78.  
  79. Pull.w:    MACRO
  80.     movem.w    (sp)+,\1
  81.     ENDM
  82.  
  83. StartPrg:    MACRO
  84.     move.w    #$7fff,Intreq+_Custom
  85.     move.w    #MyDmacon+$8000,Dmacon+_Custom
  86.     move.w    #MyIntena+$8000,Intena+_Custom
  87.     ENDM
  88.  
  89. StopPrg:    MACRO
  90.     move.w    #$7fff,Intena+_Custom
  91.     move.w    #$7fff,Dmacon+_Custom
  92.     move.w    #$7fff,Intreq+_Custom
  93.     ENDM
  94.  
  95. StopSystem:    MACRO
  96.     move.w    Intenar+_Custom,OldIntena
  97.     move.w    Dmaconr+_Custom,OldDmacon
  98.     StopPrg
  99.     bra.b    jumpo\@
  100. OldIntena:    dc.w    0
  101. OldDmacon:    dc.w    0
  102. jumpo\@:
  103.     ENDM
  104.  
  105. StartSystem:    MACRO
  106.     move.w    OldDmacon(pc),d0
  107.     or.w    #$8000,d0
  108.     move.w    d0,Dmacon+_Custom
  109.     move.w    OldIntena(pc),d0
  110.     or.w    #$8000,d0
  111.     move.w    d0,Intena+_Custom
  112.     ENDM
  113.  
  114. ClearBss:    MACRO
  115.     lea    _Bss1Start,a0
  116.     move.l    #(_Bss1End-_Bss1Start)/4,d0
  117. .clrloop\@    clr.l    (a0)+
  118.     subq.l    #1,d0
  119.     bne.b    .clrloop\@
  120.     ENDM
  121.  
  122.  
  123.  
  124.  
  125.  
  126. *******************************************************************************
  127. **
  128. **  Initialisering
  129. **
  130. *******************************************************************************
  131.     SECTION    DenFedeKode,code
  132.  
  133.     JumpPtr    Begin
  134.  
  135. Begin:    IFEQ    Track-0
  136.     INCDIR    Work:Code/LINKS/
  137.     INCLINK    LOADVIEW.LINK
  138.     Push.l    d0-a6
  139.     bsr    LW_Reset
  140.     StopSystem
  141.     ELSE
  142.     move.l    #Lev3Irq,$64.w
  143.     rts
  144.     ENDC
  145.  
  146. **Init starter -----------------------------------
  147.     ClearBss    1
  148.     ClearBss    2
  149.  
  150.     bsr    InitCodeBuffer
  151.     bsr    InitVerticalBuffer
  152.     bsr    InitInterpolBuffer
  153.     bsr    ComputeColors2
  154.     bsr    InitAGACopper
  155.     lea    ColorArray,a0
  156.     lea    AGA_Colors,a1
  157.     moveq    #0,d0
  158.     IFEQ    ECS-1
  159.     move.w    #31,d1
  160.     ELSE
  161.     move.w    #255,d1
  162.     ENDC
  163.     bsr    LoadAGACopper
  164.  
  165.     IFEQ    Track-0
  166.     SetInt    3
  167. **Init slutter -----------------------------------
  168.  
  169.     WaitBlt
  170.     StartPrg
  171.  
  172.  
  173.  
  174.  
  175. *******************************************************************************
  176. **
  177. **  Vent på exitsignal
  178. **
  179. *******************************************************************************
  180. WaitForExit:    tst.b    VBlank
  181.     beq.b    WaitForExit
  182.  
  183.     clr.b    VBlank
  184.     tst.b    IWantOut
  185.     bne.b    ExitToDos
  186.     bra.b    WaitForExit
  187.  
  188.  
  189.  
  190.  
  191. *******************************************************************************
  192. **
  193. **  Exit to AmigaDOS
  194. **
  195. *******************************************************************************
  196. ExitToDos:
  197.     StopPrg
  198.  
  199. **Exit starter -----------------------------------
  200.     ClrInt    3
  201. **Exit slutter -----------------------------------
  202.  
  203.     StartSystem
  204.  
  205.     bsr    LW_Set
  206.  
  207.     Pull.l    d0-a6
  208.     moveq    #0,d0
  209.     ENDC
  210.     rts
  211.  
  212. _GfxBase:    dc.l    0
  213. _OldView:    dc.l    0
  214.  
  215.  
  216.  
  217.  
  218. *******************************************************************************
  219. **
  220. **  Level 3 interrupt
  221. **
  222. *******************************************************************************
  223. Lev3Irq:    st    VBlank
  224.     Push.l    d0-a6
  225. **Lev3irq starter --------------------------------
  226.     move.l    #Copper,Cop2lch+_Custom
  227.     move.w    d0,Copjmp2+_Custom
  228.  
  229.     lea    Routines(pc),a0
  230.     move.w    Status(pc),d0
  231.     add.w    d0,d0
  232.     add.w    d0,d0
  233.     move.l    (a0,d0.w),a0
  234.     jsr    (a0)
  235.  
  236. **Lev3irq slutter --------------------------------
  237.     IFEQ    Track-0
  238.     btst    #6,$bfe001
  239.     bne.b    .noleft
  240.     st    IWantOut
  241. .noleft    ENDC
  242.     IF    Raster=1
  243.     move.w    #$f00,Color00+_Custom
  244.     ENDIF
  245.     WaitBlt
  246.     IF    Raster=1
  247.     move.w    #$00f,Color00+_Custom
  248.     ENDIF
  249.     move.b    $dff005,d0
  250.     lsl.w    #8,d0
  251.     move.b    $dff006,d0
  252.     cmp.w    MaxRast,d0
  253.     blt.b    .ud
  254.     move.w    d0,MaxRast
  255. .ud:
  256.     Pull.l    d0-a6
  257.     IFEQ    Track-0
  258.     move.w    #$0020,Intreq+_Custom
  259.     ELSE
  260.     move.w    #$0004,Intreq+_Custom
  261.     ENDC
  262.     rte
  263.  
  264. Status:    dc.w    0
  265. Routines:    dc.l    FadeUp,RingHandler,FadeDown
  266.  
  267. RingHandler:    bsr    SwapScr
  268.     bsr    MakeDezign
  269.     bsr    ClrScr
  270.     bsr    StoryBoard
  271.     cmp.w    #28000,ZCenter
  272.     bge.b    .none
  273.     bsr    Rotate
  274.     bsr    DrawFaces
  275. .none
  276.     cmp.w    #30000,ZCenter
  277.     bne.w    .out
  278.     st    IWantOut
  279. .out    rts
  280.  
  281. DezignPtr:    dc.w    0
  282. DezStat:    dc.w    0
  283. MakeDezign:    move.w    DezStat(pc),d0
  284.     beq.b    Dez_MakeIt
  285.     subq.w    #2,d0
  286.     beq.b    Dez_RemoveIt
  287.     rts
  288. Dez_MakeIt:    cmp.w    #8*21,DezignPtr
  289.     bne.b    .doit
  290.     addq.w    #1,DezStat
  291. .doit    lea    DezignJohn,a0
  292.     cmp.w    #$38,DezignPtr
  293.     ble.b    .ok
  294.     subq.w    #4,a0
  295. .ok    move.w    DezignPtr(pc),d0
  296.     lsl.w    #4,d0
  297.     sub.w    d0,a0
  298.     move.w    #$403,-10(a0)
  299.     addq.w    #1,DezignPtr
  300.     rts
  301. Dez_RemoveIt:    tst.w    DezignPtr
  302.     bgt.b    .doit
  303.     addq.w    #1,DezStat
  304.     rts
  305. .doit    subq.w    #1,DezignPtr
  306.     lea    DezignJohn,a0
  307.     cmp.w    #$38,DezignPtr
  308.     ble.b    .ok
  309.     subq.w    #4,a0
  310. .ok    move.w    DezignPtr(pc),d0
  311.     lsl.w    #4,d0
  312.     sub.w    d0,a0
  313.     move.w    #$103,-10(a0)
  314.     rts
  315.  
  316.  
  317. FadeUp:    move.l    #FadeCopper,Cop2lch+_Custom
  318.     move.w    d0,Copjmp2+_Custom
  319.  
  320.     move.w    FadeCopper|.col+2,d0
  321.     move.w    #$103,d1
  322.     bsr    fader
  323.     move.w    d0,FadeCopper|.col+2
  324.     cmp.w    #$103,d0
  325.     bne.b    .out
  326.     addq.w    #1,Status
  327. .out    rts
  328.     
  329. FadeDown:    move.l    #FadeCopper,Cop2lch+_Custom
  330.     move.w    d0,Copjmp2+_Custom
  331.  
  332.     move.w    FadeCopper|.col+2,d0
  333.     moveq    #0,d1
  334.     bsr    fader
  335.     move.w    d0,FadeCopper|.col+2
  336.     tst.w    d0
  337.     seq    IWantOut
  338.     rts
  339.     
  340.  
  341.  
  342.  
  343. **d0=fade from
  344. **d1=fade to
  345. **out: d0=newcol
  346. fader:    move.w    d0,d2
  347.     move.w    d1,d3
  348.     lsr.w    #8,d2
  349.     lsr.w    #8,d3
  350.     cmp.w    d2,d3
  351.     beq.b    .nored
  352.     blt.b    .redsub
  353.     add.w    #$100,d0
  354.     bra.b    .nored
  355. .redsub:    sub.w    #$100,d0
  356. .nored:    move.w    d0,d2
  357.     move.w    d1,d3
  358.     lsr.w    #4,d2
  359.     lsr.w    #4,d3
  360.     and.w    #$f,d2
  361.     and.w    #$f,d3
  362.     cmp.w    d2,d3
  363.     beq.b    .nogreen
  364.     blt.b    .greensub
  365.     add.w    #$10,d0
  366.     bra.b    .nogreen
  367. .greensub:    sub.w    #$10,d0
  368. .nogreen:    move.w    d0,d2
  369.     move.w    d1,d3
  370.     and.w    #$f,d2
  371.     and.w    #$f,d3
  372.     cmp.w    d2,d3
  373.     beq.b    .noblue
  374.     blt.b    .bluesub
  375.     addq.w    #$1,d0
  376.     bra.b    .noblue
  377. .bluesub:    subq.w    #$1,d0
  378. .noblue:    rts
  379.  
  380.  
  381. *******************************************************************************
  382. **
  383. **  Storyboard
  384. **
  385. *******************************************************************************
  386. StoryBoard:    move.w    Story,d0
  387.     beq.b    Story_00
  388.     subq.w    #1,d0
  389.     beq.b    Story_01
  390.     subq.w    #1,d0
  391.     beq.w    Story_02
  392.     subq.w    #1,d0
  393.     beq.w    Story_03
  394.     subq.w    #1,d0
  395.     beq.w    Story_04
  396.     rts
  397.  
  398. Story_00:    sub.w    #100,XCenter
  399.     beq.b    .out
  400.     rts
  401. .out    clr.w    YAdd
  402.     addq.w    #1,Story
  403.     move.w    #3000,StoryData3
  404.     rts
  405.  
  406. Story_01:    lea    Story_01_Sine,a0
  407.     move.w    StoryData1,d0
  408.     add.w    d0,d0
  409.     move.w    (a0,d0.w),d0
  410.     muls    StoryData3,d0
  411.     divs    #3000,d0
  412.     move.w    d0,d7
  413.     move.w    d0,d1
  414.     sub.w    StoryData2,d0
  415.     move.w    d1,StoryData2
  416.     sub.w    d0,Coords+0*6
  417.     sub.w    d0,Coords+1*6
  418.     sub.w    d0,Coords+4*6
  419.     sub.w    d0,Coords+5*6
  420.     addq.w    #1,StoryData1
  421.     and.w    #32-1,StoryData1
  422.  
  423.     asr.w    #2,d7
  424.     neg.w    d7
  425.     add.w    d7,d7
  426.     move.w    d7,YAngle2
  427.     and.w    #2048-1,YAngle2
  428.  
  429.     sub.w    #30,StoryData3
  430.     bge.b    .out
  431.     addq.w    #1,Story
  432.     clr.w    StoryData1
  433.     move.w    #256*2,StoryData2
  434. .out    rts
  435.  
  436. Story_02:    lea    XAdd,a0
  437.     cmp.w    #6,(a0)+
  438.     beq.b    .xok
  439.     addq.w    #2,-2(a0)
  440. .xok    cmp.w    #-2,(a0)+
  441.     beq.b    .yok
  442.     subq.w    #2,-2(a0)
  443. .yok    cmp.w    #6,(a0)+
  444.     beq.b    .zok
  445.     addq.w    #2,-2(a0)
  446.     rts
  447. .zok    addq.w    #1,Story
  448.     move.w    #25*50,StoryPause
  449.     rts
  450.  
  451. Story_03:    bsr    TransformObj
  452.     subq.w    #1,StoryPause
  453.     bne.b    .ok
  454.     addq.w    #1,Story
  455.     addq.w    #1,DezStat
  456. .ok    rts
  457.  
  458. Story_04:    lea    SinTable,a0
  459.     move.w    StoryData1,d1
  460.     move.w    StoryData2,d2
  461.     move.w    StoryData3,d3
  462.  
  463.     add.w    #100,ZCenter
  464.  
  465.     move.w    (a0,d2.w),d2
  466.     muls    #3500,d2
  467.     asr.l    #8,d2
  468.     asr.l    #6,d2
  469.     move.w    ZCenter,d3
  470.     sub.w    #6000,d3
  471.     muls    d3,d2
  472.     divs    #12000,d2
  473.     move.w    d2,YCenter
  474.  
  475.     move.w    (a0,d1.w),d1
  476.     muls    #3500,d1
  477.     asr.l    #8,d1
  478.     asr.l    #6,d1
  479.     move.w    ZCenter,d3
  480.     sub.w    #6000,d3
  481.     muls    d3,d1
  482.     divs    #12000,d1
  483.     move.w    d1,XCenter
  484.  
  485.     lea    StoryData1,a0
  486.     add.w    #32,(a0)
  487.     and.w    #2048-1,(a0)+
  488.     add.w    #32,(a0)
  489.     and.w    #2048-1,(a0)+
  490.     addq.w    #4,(a0)
  491.     and.w    #2048-1,(a0)+
  492.     bsr    TransformObj
  493.     rts
  494.  
  495. StoryData1:    dc.w    0
  496. StoryData2:    dc.w    0
  497. StoryData3:    dc.w    0
  498. StoryPause:    dc.w    0
  499.  
  500. *******************************************************************************
  501. **
  502. **  Compute some colors
  503. **
  504. *******************************************************************************
  505. ComputeColors2:    lea    .colors+4,a0
  506.     move.l    #$00404b,d0
  507.     move.l    #$00c8b4,d1
  508.     moveq    #0,d6
  509.     IFEQ    ECS-1
  510.     moveq    #4,d7
  511.     ELSE
  512.     moveq    #7,d7
  513.     ENDC
  514. .makecols    bsr    FadeAGA
  515.     move.l    d2,(a0)+
  516.     addq.w    #1,d6
  517.     IFEQ    ECS-1
  518.     cmp.w    #5,d6
  519.     ELSE
  520.     cmp.w    #8,d6
  521.     ENDC
  522.     bne.b    .makecols
  523.     lea    ColorArray,a0
  524.     moveq    #0,d0
  525. .exanext    moveq    #7,d1
  526.     moveq    #0,d2
  527. .testigen    btst    d1,d0
  528.     beq.b    .a_zero
  529.     addq.w    #1,d2
  530. .a_zero    dbra    d1,.testigen
  531.     add.w    d2,d2
  532.     add.w    d2,d2
  533.     move.l    .colors(PC,d2.w),d2
  534.     move.l    d2,(a0)+
  535.     addq.w    #1,d0
  536.     IFEQ    ECS-1
  537.     cmp.w    #32,d0
  538.     ELSE
  539.     cmp.w    #256,d0
  540.     ENDC
  541.     bne.b    .exanext
  542.     rts
  543. .colors    dc.l    $110033
  544.     IFEQ    ECS-1
  545.     blk.l    5,0
  546.     ELSE
  547.     blk.l    8,0
  548.     ENDC
  549.  
  550.  
  551.  
  552.  
  553. *******************************************************************************
  554. **
  555. **  Fade 24bit colors
  556. **
  557. **  input:
  558. **  d0.l=source color
  559. **  d1.l=dest color
  560. **  d6.w=step
  561. **  d7.w=last step
  562. **
  563. **  output:
  564. **  d2.l=new color
  565. **
  566. **  trashed regs:
  567. **  d0-d6
  568. **
  569. *******************************************************************************
  570. FadeAGA:    move.l    d0,d2
  571.     move.l    d1,d3
  572.     swap    d2
  573.     swap    d3
  574.     sub.w    d2,d3
  575.     muls    d6,d3
  576.     divs    d7,d3
  577.     add.w    d2,d3
  578.     swap    d3
  579.     clr.w    d3        ;R
  580.     move.l    d0,d2
  581.     move.l    d1,d4
  582.     and.w    #$ff00,d2
  583.     and.w    #$ff00,d4
  584.     sub.w    d2,d4
  585.     lsr.w    #8,d4
  586.     muls    d6,d4
  587.     divs    d7,d4
  588.     lsl.w    #8,d4
  589.     add.w    d2,d4
  590.     and.l    #$00ff00,d4    ;G
  591.     move.w    d0,d5
  592.     move.w    d1,d2
  593.     and.w    #$00ff,d5
  594.     and.w    #$00ff,d2
  595.     sub.w    d5,d2
  596.     muls    d6,d2
  597.     divs    d7,d2
  598.     add.w    d5,d2
  599.     and.l    #$0000ff,d2    ;B
  600.     or.l    d3,d2
  601.     or.l    d4,d2    ;color
  602.     rts
  603.  
  604.  
  605.  
  606.  
  607.  
  608. *******************************************************************************
  609. **
  610. **  Load AGA copper with colors
  611. **
  612. **  input:
  613. **  a0.l=24bit color array (00000000RRRRRRRRGGGGGGGGBBBBBBBB per color)
  614. **  a1.l=initialized aga copper array
  615. **  d0.w=start color
  616. **  d1.w=end color
  617. **
  618. *******************************************************************************
  619. LoadAGACopper:
  620.     IFEQ    ECS-0
  621.     moveq    #0,d2    ;color index to current bank
  622.     sub.w    d0,d1    ;number of colors to load
  623.     move.w    d1,d7    ;color countdown
  624.     move.w    d0,d6
  625.     beq.b    .noskip
  626.     add.w    d0,d0
  627.     add.w    d0,d0
  628.     add.w    d0,a0    ;skip first colors
  629.     move.w    d6,d0
  630.     lsr.w    #5,d0
  631.     mulu    #33*2*4,d0
  632.     add.w    d0,a1    ;skip first banks
  633.     and.w    #$1f,d6
  634. .noskip    addq.w    #4,a1
  635.     clr.w    -(sp)
  636.     lea    33*4(a1),a2    ;lower nibbles
  637. .next    move.l    (a0)+,d0
  638.     move.l    d0,d3
  639.     move.w    d0,d1
  640.     move.l    d0,d2
  641.     and.w    #$000f,d0
  642.     and.w    #$0f00,d1
  643.     lsr.w    #4,d1
  644.     swap    d2
  645.     and.w    #$f,d2
  646.     lsl.w    #8,d2
  647.     or.w    d2,d1
  648.     or.w    d1,d0
  649.     move.w    d0,2(a2)
  650.     move.l    d3,d0
  651.     move.w    d0,d1
  652.     move.l    d0,d2
  653.     and.w    #$f0,d0
  654.     lsr.w    #4,d0
  655.     move.w    d1,(sp)
  656.     move.b    (sp),d1
  657.     and.w    #$00f0,d1
  658.     swap    d2
  659.     and.w    #$00f0,d2
  660.     lsl.w    #4,d2
  661.     or.w    d2,d1
  662.     or.w    d1,d0
  663.     move.w    d0,2(a1)
  664.     addq.w    #4,a1
  665.     addq.w    #4,a2
  666.     subq.w    #1,d7
  667.     blt.b    .out
  668.     addq.w    #1,d6
  669.     cmp.w    #$20,d6
  670.     bne.b    .next
  671.     lea    34*4(a1),a1
  672.     lea    34*4(a2),a2
  673.     moveq    #0,d6
  674.     bra.b    .next
  675. .out    clr.w    (sp)+
  676.     rts
  677.     ELSE
  678.     sub.w    d0,d1
  679.     add.w    d0,d0
  680.     add.w    d0,d0
  681.     lea    2(a1,d0.w),a1
  682. .loop    move.l    (a0)+,d2
  683.     move.l    d2,d3
  684.     move.l    d2,d4
  685.     swap    d4
  686.     lsl.w    #4,d4
  687.     and.w    #$f00,d4
  688.     lsr.w    #8,d3
  689.     and.w    #$0f0,d3
  690.     lsr.w    #4,d2
  691.     and.w    #$00f,d2
  692.     or.w    d2,d3
  693.     or.w    d3,d4
  694.     move.w    d4,(a1)
  695.     addq.w    #4,a1
  696.     dbra    d1,.loop
  697.     rts
  698.     ENDC
  699.  
  700.  
  701.  
  702.  
  703. *******************************************************************************
  704. **
  705. **  Init AGA copper-array
  706. **
  707. *******************************************************************************
  708. InitAGACopper:    lea    AGA_Colors,a0
  709.     IFEQ    ECS-0
  710.     move.l    #Bplcon3<<16!$0c40,d0
  711.     move.l    #Bplcon3<<16!$0e40,d1
  712.     moveq    #8-1,d7
  713. .loop    move.l    d0,(a0)+
  714.     bsr    .fillit
  715.     move.l    d1,(a0)+
  716.     bsr    .fillit
  717.     add.w    #$2000,d0
  718.     add.w    #$2000,d1
  719.     dbra    d7,.loop
  720.     rts
  721.     ENDC
  722. .fillit    move.w    #Color00,d2
  723.     moveq    #32-1,d6
  724. .fillloop    move.w    d2,(a0)+
  725.     clr.w    (a0)+
  726.     addq.w    #2,d2
  727.     dbra    d6,.fillloop
  728.     rts
  729.  
  730. *******************************************************************************
  731. **
  732. **  Draw a dotted line
  733. **
  734. **  input:
  735. **    d0-d3: coords
  736. **
  737. *******************************************************************************
  738. DrawLine:    MACRO
  739.     cmp.w    d0,d2
  740.     bge.b    .ok\@
  741.     exg    d0,d2
  742.     exg    d1,d3
  743. .ok\@    move.w    d0,d5
  744.     move.w    d1,d6
  745.  
  746.     lea    VerticalMulsTab,a1
  747.     sub.w    d1,d3
  748.     add.w    #256,d3
  749.     add.w    d3,d3
  750.     add.w    d3,d3
  751.     move.l    (a1,d3.w),a1
  752.  
  753.     lea    CodeMulsTab,a2
  754.     sub.w    d0,d2
  755.     lsl.w    #3,d2
  756.     and.w    #$7,d0
  757.     add.w    d0,d2
  758.     add.w    d2,d2
  759.     add.w    d2,d2
  760.     move.l    (a2,d2.w),a2
  761.  
  762.     lsl.w    #4,d6
  763.     move.w    d6,d7
  764.     lsl.w    #2,d7
  765.     add.w    d7,d6
  766.     asr.w    #3,d5
  767.     add.w    d5,d6
  768.     move.l    Screen_Draw,a0
  769.     lea    (a0,d6.w),a0
  770.     moveq    #0,d0
  771.     moveq    #1,d1
  772.     moveq    #2,d2
  773.     moveq    #3,d3
  774.     moveq    #4,d4
  775.     moveq    #5,d5
  776.     moveq    #6,d6
  777.     moveq    #7,d7
  778.     jsr    (a2)
  779.     ENDM
  780.  
  781.  
  782.  
  783.  
  784. *******************************************************************************
  785. **
  786. **  Prøv lidt rotation
  787. **
  788. *******************************************************************************
  789. Rotate:    lea    Coords,a0
  790.     lea    PerspCoords,a1
  791.     lea    CosTable,a2
  792.     lea    SinTable,a3
  793.     lea    Angles,a4
  794.     lea    XCenter,a5
  795.     sub.w    a6,a6
  796.  
  797. .nextkoord    cmp.w    #$8000,(a0)
  798.     beq.w    .out
  799.  
  800.     move.w    (a0)+,d0
  801. .RotXY:    move.w    (a0)+,d1    ;d0=Xp , d1=Yp & d2=Vinkel
  802.     move    (a4),d2
  803.     move    (a2,d2.w),d3
  804.     move    (a3,d2.w),d4
  805.     move    d0,d7
  806.     move    d1,d6
  807.     muls    d3,d0
  808.     muls    d4,d1
  809.     muls    d4,d7
  810.     muls    d3,d6
  811.     sub.l    d1,d0
  812.     add.l    d6,d7
  813.     lsl.l    #2,d0
  814.     lsl.l    #2,d7
  815.     swap    d0        ;X
  816.     swap    d7        ;Y
  817. .RotXZ:    move    (a0)+,d1    ;d0=Xp , d1=Zp & d2=Vinkel
  818.     move    2(a4),d2
  819.     move.w    a6,d3
  820.     btst    #1,d3
  821.     bne.b    .nope
  822.     move.w    YAngle2,d2
  823. .nope    move    (a2,d2.w),d3
  824.     move    (a3,d2.w),d4
  825.     move    d0,d5
  826.     move    d1,d6
  827.     muls    d3,d0
  828.     muls    d4,d1
  829.     muls    d4,d5
  830.     muls    d3,d6
  831.     sub.l    d1,d0
  832.     add.l    d6,d5
  833.     lsl.l    #2,d0
  834.     lsl.l    #2,d5
  835.     swap    d0        ;X
  836.     swap    d5        ;Z
  837. .RotYZ:    move    4(a4),d2    ;d7=Yp , d5=Zp & d2=Vinkel
  838.     move    (a2,d2.w),d3
  839.     move    (a3,d2.w),d4
  840.     move    d7,d1
  841.     move    d5,d6
  842.     muls    d3,d7
  843.     muls    d4,d5
  844.     muls    d4,d1
  845.     muls    d3,d6
  846.     sub.l    d5,d7
  847.     add.l    d6,d1
  848.     lsl.l    #2,d7
  849.     lsl.l    #2,d1
  850.     swap    d7        ;Y
  851.     swap    d1        ;Z
  852. .MakePer:    add.w    4(a5),d1    ;Z
  853.     add.w    (a5),d0
  854.     add.w    2(a5),d7
  855.     ext.l    d0
  856.     ext.l    d7
  857.     lsl.l    #8,d0
  858.     lsl.l    #8,d7
  859.     divs    d1,d0
  860.     divs    d1,d7
  861.     add    #320/2,d0
  862.     add    #256/2,d7
  863. .GemCor:    move    d0,(a1)+
  864.     move    d7,(a1)+
  865.     addq.w    #1,a6
  866.     bra.w    .nextkoord
  867. .out:    lea    XAdd,a1
  868.     lea    Angles,a0
  869.     move.w    (a1)+,d0
  870.     add.w    d0,(a0)
  871.     and.w    #2048-1,(a0)+
  872.     move.w    (a1)+,d0
  873.     add.w    d0,(a0)
  874.     and.w    #2048-1,(a0)+
  875.     move.w    (a1)+,d0
  876.     add.w    d0,(a0)
  877.     and.w    #2048-1,(a0)+
  878.     cmp.w    #1,Story
  879.     beq.b    .heltiskoven
  880.     move.w    Angles+2,YAngle2
  881. .heltiskoven    rts
  882.  
  883.  
  884.  
  885.  
  886. *******************************************************************************
  887. **
  888. **  Clear screen using blitter
  889. **
  890. *******************************************************************************
  891. ClrScr:    lea    _Custom,a6
  892.     WaitBlt
  893.     move.l    Screen_Clear,Bltdpth(a6)
  894.     move.l    #$01000000,Bltcon0(a6)
  895.     move.w    #40,Bltdmod(a6)
  896.     move.w    #20,Bltsizh(a6)
  897.     move.w    #256,Bltsizv(a6)
  898. ;    move.w    #256<<6!20,Bltsize(a6)
  899.     rts
  900.  
  901.  
  902.  
  903.  
  904. *******************************************************************************
  905. **
  906. **  Swap screen for doublebuffering!
  907. **
  908. *******************************************************************************
  909. SwapScr:    IFEQ    ECS-1
  910.     lea    Screen_Clear+7*4,a0
  911.     ELSE
  912.     lea    Screen_Clear+10*4,a0
  913.     ENDC
  914.     lea    -4(a0),a1
  915.     move.l    (a1),d7
  916.     IFEQ    ECS-1
  917.     moveq    #6-1,d6
  918.     ELSE
  919.     moveq    #9-1,d6
  920.     ENDC
  921. .cloop    move.l    -(a1),-(a0)
  922.     dbra    d6,.cloop
  923.     move.l    d7,(a1)
  924.  
  925.     lea    Copper_PlanePtr+2,a3
  926.     lea    Screen_Show,a0
  927.     IFEQ    ECS-1
  928.     moveq    #5-1,d7
  929.     ELSE
  930.     moveq    #8-1,d7
  931.     ENDC
  932. .loop    move.l    (a0)+,d0
  933.     move.w    d0,4(a3)
  934.     swap    d0
  935.     move.w    d0,(a3)
  936.     addq.w    #8,a3
  937.     dbra    d7,.loop
  938.     rts
  939.  
  940.  
  941.  
  942.  
  943. *******************************************************************************
  944. **
  945. **  Initialiser InterpolBuffer
  946. **
  947. *******************************************************************************
  948. InitInterpolBuffer:
  949.     lea    InterpolBuffer,a6
  950.     move.w    #-320,d0    ;size
  951. .nextsize    moveq    #MatrixSize-1,d1    ;trinnummer
  952. .loop    move.w    d0,d2
  953.     muls    d1,d2
  954.     divs    #MatrixSize-1,d2    ;linjenummer
  955.     move.w    d2,(a6)+
  956.     IFEQ    Track-0
  957.     move.w    a6,$dff180
  958.     ENDC
  959.     dbra    d1,.loop
  960.     addq.w    #1,d0
  961.     cmp.w    #319,d0
  962.     ble.b    .nextsize
  963.     rts
  964.  
  965.  
  966.  
  967.  
  968. *******************************************************************************
  969. **
  970. **  Initialiser VerticalBuffer
  971. **
  972. *******************************************************************************
  973. InitVerticalBuffer:
  974.     lea    VerticalBuffer,a6
  975.     lea    VerticalMulsTab,a5
  976.     move.w    #-256,d0    ;size
  977. .nextsize    moveq    #MatrixSize-1,d1    ;trinnummer
  978.     move.l    a6,(a5)+
  979. .loop    move.w    d0,d2
  980.     muls    d1,d2
  981.     divs    #MatrixSize-1,d2    ;linjenummer
  982.     muls    #80,d2
  983.     move.w    d2,(a6)+
  984.     IFEQ    Track-0
  985.     move.w    a6,$dff180
  986.     ENDC
  987.     dbra    d1,.loop
  988.     addq.w    #1,d0
  989.     cmp.w    #255,d0
  990.     ble.b    .nextsize
  991.     rts
  992.  
  993.  
  994.  
  995.  
  996. *******************************************************************************
  997. **
  998. **  Initialiser CodeBuffer
  999. **
  1000. *******************************************************************************
  1001. InitCodeBuffer:    lea    DotInstructions(pc),a0
  1002.     lea    CodeBuffer,a6
  1003.     lea    CodeMulsTab,a5
  1004.     moveq    #0,d0    ;startpixel
  1005.     moveq    #0,d1    ;stoppixel
  1006. .nextsize    moveq    #8-1,d5    ;bits per byte
  1007. .nextbit    move.l    a6,(a5)+
  1008.     moveq    #MatrixSize-1,d2    ;trinnummer
  1009. .loop    move.w    d1,d3
  1010.     sub.w    d0,d3
  1011.     mulu    d2,d3
  1012.     divu    #MatrixSize-1,d3
  1013.     add.w    d0,d3    ;pixelnummer
  1014.     move.w    d3,d4
  1015.     lsr.w    #3,d3
  1016.     and.w    #$7,d4
  1017.     add.w    d4,d4
  1018.     add.w    d4,d4
  1019.     move.w    (a0),(a6)+
  1020.     move.w    2(a0,d4.w),(a6)+
  1021.     move.b    4(a0,d4.w),(a6)+
  1022.     move.b    d3,(a6)+
  1023.     dbra    d2,.loop
  1024.     move.w    RtsCode(pc),(a6)+
  1025.     IFEQ    Track-0
  1026.     move.w    a6,$dff180
  1027.     ENDC
  1028.     addq.w    #1,d0
  1029.     addq.w    #1,d1
  1030.     dbra    d5,.nextbit
  1031.     subq.w    #8,d0
  1032.     subq.w    #7,d1
  1033.     cmp.w    #319,d1
  1034.     ble.b    .nextsize
  1035.     rts
  1036.  
  1037. DotInstructions:    move.w    (a1)+,a2        ;8
  1038.     bset    d7,$0(a0,a2.w)    ;18
  1039. BytesPerDot:    EQU    *-DotInstructions
  1040.     bset    d6,$0(a0,a2.w)
  1041.     bset    d5,$0(a0,a2.w)
  1042.     bset    d4,$0(a0,a2.w)
  1043.     bset    d3,$0(a0,a2.w)
  1044.     bset    d2,$0(a0,a2.w)
  1045.     bset    d1,$0(a0,a2.w)
  1046.     bset    d0,$0(a0,a2.w)
  1047. RtsCode:    rts
  1048.  
  1049.  
  1050.  
  1051.  
  1052. DrawFaces:    lea    PerspCoords,a0
  1053.     lea    Faces,a1
  1054.  
  1055.     moveq    #0,d6
  1056.     moveq    #0,d7
  1057.     move.b    (a1)+,d6
  1058.     add.w    d6,d6
  1059.     add.w    d6,d6
  1060.     move.b    (a1)+,d7
  1061.     add.w    d7,d7
  1062.     add.w    d7,d7
  1063.     move.w    (a0,d6.w),d0
  1064.     move.w    2(a0,d6.w),d1
  1065.     move.w    (a0,d7.w),d2
  1066.     move.w    2(a0,d7.w),d3
  1067.     lea    SideBuffer1,a2
  1068.     bsr    .interpol
  1069.  
  1070.     moveq    #0,d6
  1071.     moveq    #0,d7
  1072.     move.b    (a1)+,d6
  1073.     add.w    d6,d6
  1074.     add.w    d6,d6
  1075.     move.b    (a1)+,d7
  1076.     add.w    d7,d7
  1077.     add.w    d7,d7
  1078.     move.w    (a0,d6.w),d0
  1079.     move.w    2(a0,d6.w),d1
  1080.     move.w    (a0,d7.w),d2
  1081.     move.w    2(a0,d7.w),d3
  1082.     lea    SideBuffer2,a2
  1083.     bsr    .interpol
  1084.  
  1085.     lea    FaceBuffer1,a2
  1086.     lea    SideBuffer1,a3
  1087.     lea    SideBuffer2,a4
  1088.     REPT    MatrixSize
  1089.     move.w    (a3)+,d0
  1090.     move.w    (a3)+,d1
  1091.     move.w    (a4)+,d2
  1092.     move.w    (a4)+,d3
  1093.     Push.l    a3/a4
  1094.     bsr    .interpol
  1095.     Pull.l    a3/a4
  1096.     ENDR
  1097.  
  1098.  
  1099.     moveq    #0,d6
  1100.     moveq    #0,d7
  1101.     move.b    (a1)+,d6
  1102.     add.w    d6,d6
  1103.     add.w    d6,d6
  1104.     move.b    (a1)+,d7
  1105.     add.w    d7,d7
  1106.     add.w    d7,d7
  1107.     move.w    (a0,d6.w),d0
  1108.     move.w    2(a0,d6.w),d1
  1109.     move.w    (a0,d7.w),d2
  1110.     move.w    2(a0,d7.w),d3
  1111.     lea    SideBuffer1,a2
  1112.     bsr    .interpol
  1113.  
  1114.     moveq    #0,d6
  1115.     moveq    #0,d7
  1116.     move.b    (a1)+,d6
  1117.     add.w    d6,d6
  1118.     add.w    d6,d6
  1119.     move.b    (a1)+,d7
  1120.     add.w    d7,d7
  1121.     add.w    d7,d7
  1122.     move.w    (a0,d6.w),d0
  1123.     move.w    2(a0,d6.w),d1
  1124.     move.w    (a0,d7.w),d2
  1125.     move.w    2(a0,d7.w),d3
  1126.     lea    SideBuffer2,a2
  1127.     bsr    .interpol
  1128.  
  1129.     lea    FaceBuffer2,a2
  1130.     lea    SideBuffer1,a3
  1131.     lea    SideBuffer2,a4
  1132.     REPT    MatrixSize
  1133.     move.w    (a3)+,d0
  1134.     move.w    (a3)+,d1
  1135.     move.w    (a4)+,d2
  1136.     move.w    (a4)+,d3
  1137.     Push.l    a3/a4
  1138.     bsr    .interpol
  1139.     Pull.l    a3/a4
  1140.     ENDR
  1141.  
  1142.  
  1143.  
  1144.     lea    FaceBuffer1,a5
  1145.     lea    FaceBuffer2,a6
  1146.     REPT    MatrixSize*MatrixSize
  1147.     move.w    (a5)+,d0
  1148.     move.w    (a5)+,d1
  1149.     move.w    (a6)+,d2
  1150.     move.w    (a6)+,d3
  1151.     DrawLine
  1152.     ENDR
  1153.  
  1154.     rts
  1155.  
  1156. .interpol    lea    InterpolBuffer,a3
  1157.     sub.w    d0,d2
  1158.     sub.w    d1,d3
  1159.     add.w    #320,d2
  1160.     add.w    #320,d3
  1161.     muls    #MatrixSize*2,d2
  1162.     muls    #MatrixSize*2,d3
  1163.     lea    (a3,d2.w),a4
  1164.     lea    (a3,d3.w),a5
  1165.     REPT    MatrixSize
  1166.     move.w    (a4)+,d5
  1167.     add.w    d0,d5
  1168.     move.w    d5,(a2)+
  1169.     move.w    (a5)+,d5
  1170.     add.w    d1,d5
  1171.     move.w    d5,(a2)+
  1172.     ENDR
  1173.     rts
  1174.  
  1175.  
  1176.  
  1177. TransformObj:    tst.w    TransPause
  1178.     bne.b    .pause
  1179.     move.l    TransPointer,a0
  1180.     lea    Coords,a1
  1181.     moveq    #0,d6
  1182.     moveq    #3*8-1,d7
  1183. .loop    move.w    (a0)+,d0
  1184.     sub.w    (a1),d0
  1185.     beq.b    .nothing
  1186.     bpl.b    .plus
  1187.     sub.w    #50,(a1)+
  1188.     bra.b    .donext
  1189. .plus    add.w    #50,(a1)+
  1190.     bra.b    .donext
  1191. .nothing    addq.w    #1,d6
  1192.     addq.w    #2,a1
  1193. .donext    dbra    d7,.loop
  1194.     cmp.w    #3*8,d6
  1195.     bne.b    .out
  1196.     cmp.w    #$8000,(a0)
  1197.     bne.b    .noend
  1198.     lea    TransObjects,a0
  1199. .noend    move.l    a0,TransPointer
  1200.     move.w    #50*3,TransPause
  1201. .out    rts
  1202. .pause    subq.w    #1,TransPause
  1203.     rts
  1204.  
  1205.  
  1206.  
  1207. *******************************************************************************
  1208. **
  1209. **  Variable
  1210. **
  1211. *******************************************************************************
  1212.     SECTION    SjovData,data
  1213.  
  1214. Faces:    dc.b    0,1,3,2
  1215.     dc.b    4,5,7,6
  1216.  
  1217. Coords:    dc.w    -1500,-1500,-1500    ;0
  1218.     dc.w    1500,-1500,-1500    ;1
  1219.     dc.w    1500,1500,-1500    ;2
  1220.     dc.w    -1500,1500,-1500    ;3
  1221.     dc.w    -1500,-1500,1500    ;4
  1222.     dc.w    1500,-1500,1500    ;5
  1223.     dc.w    1500,1500,1500    ;6
  1224.     dc.w    -1500,1500,1500    ;7
  1225.     dc.w    $8000
  1226.  
  1227. TransObjects:    dc.w    -1500,-1500,-1500    ;0
  1228.     dc.w    1500,-1500,-1500    ;1
  1229.     dc.w    1500,1500,-1500    ;2
  1230.     dc.w    -1500,1500,-1500    ;3
  1231.     dc.w    -1500,-1500,1500    ;4
  1232.     dc.w    1500,-1500,1500    ;5
  1233.     dc.w    1500,1500,1500    ;6
  1234.     dc.w    -1500,1500,1500    ;7
  1235.  
  1236.     dc.w    1500,-1500,-1500    ;1
  1237.     dc.w    1500,1500,-1500    ;2
  1238.     dc.w    -1500,1500,-1500    ;3
  1239.     dc.w    -1500,-1500,-1500    ;0
  1240.     dc.w    -1500,-1500,1500    ;4
  1241.     dc.w    1500,-1500,1500    ;5
  1242.     dc.w    1500,1500,1500    ;6
  1243.     dc.w    -1500,1500,1500    ;7
  1244.  
  1245.     dc.w    -0,-1500,-1500    ;0
  1246.     dc.w    1500,-1500,1500    ;1
  1247.     dc.w    0,1500,-1500    ;2
  1248.     dc.w    -1500,1500,1500    ;3
  1249.     dc.w    -0,-1500,1500    ;4
  1250.     dc.w    1500,-1500,-1500    ;5
  1251.     dc.w    0,1500,1500    ;6
  1252.     dc.w    -1500,1500,-1500    ;7
  1253.  
  1254.     dc.w    1500,1500,-1500    ;2
  1255.     dc.w    -1500,1500,-1500    ;3
  1256.     dc.w    -1500,-1500,-1500    ;0
  1257.     dc.w    1500,-1500,-1500    ;1
  1258.     dc.w    -1500,-1500,1500    ;4
  1259.     dc.w    1500,-1500,1500    ;5
  1260.     dc.w    1500,1500,1500    ;6
  1261.     dc.w    -1500,1500,1500    ;7
  1262.  
  1263.     dc.w    0,0,0        ;0
  1264.     dc.w    1500,-1500,-1500    ;1
  1265.     dc.w    1500,1500,-1500    ;2
  1266.     dc.w    -1500,1500,-1500    ;3
  1267.     dc.w    -1500,-1500,1500    ;4
  1268.     dc.w    1500,-1500,1500    ;5
  1269.     dc.w    0,0,0    ;6
  1270.     dc.w    -1500,1500,1500    ;7
  1271.  
  1272.     dc.w    1500,1500,1500    ;6
  1273.     dc.w    1500,-1500,-1500    ;1
  1274.     dc.w    1500,1500,-1500    ;2
  1275.     dc.w    -1500,1500,-1500    ;3
  1276.     dc.w    -1500,-1500,1500    ;4
  1277.     dc.w    1500,-1500,1500    ;5
  1278.     dc.w    -1500,-1500,-1500    ;0
  1279.     dc.w    -1500,1500,1500    ;7
  1280.  
  1281.     dc.w    $8000
  1282.  
  1283. TransPointer:    dc.l    TransObjects
  1284.  
  1285. Screen_Clear:    dc.l    Screen1
  1286. Screen_Draw:    dc.l    Screen2
  1287. Screen_Show:    dc.l    Screen3
  1288.     dc.l    Screen4
  1289.     dc.l    Screen5
  1290.     dc.l    Screen6
  1291.     dc.l    Screen7
  1292.     IFEQ    ECS-0
  1293.     dc.l    Screen8
  1294.     dc.l    Screen9
  1295.     dc.l    Screen10
  1296.     ENDC
  1297.  
  1298. XCenter:    dc.w    6300
  1299. YCenter:    dc.w    0
  1300. ZCenter:    dc.w    6000
  1301.  
  1302. XAdd:    dc.w    0
  1303. YAdd:    dc.w    -20
  1304. ZAdd:    dc.w    0
  1305.  
  1306. Angles:    dc.w    0
  1307.     dc.w    (62*20)&2047
  1308.     dc.w    0
  1309. YAngle2:    dc.w    0
  1310.  
  1311. Story_01_Sine:    ;    0,360,32,1300,0,w,1,y,n
  1312.     DC.W    $007F,$0179,$0264,$0338,$03EC,$047A,$04DC,$050D,$050D,$04DC
  1313.     DC.W    $047A,$03EC,$0338,$0264,$0179,$007F,$FF81,$FE87,$FD9C,$FCC8
  1314.     DC.W    $FC14,$FB86,$FB24,$FAF3,$FAF3,$FB24,$FB86,$FC14,$FCC8,$FD9C
  1315.     DC.W    $FE87,$FF81
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321. ;Option nº  = 1
  1322. ;Min. y-val = -1.63840E+04
  1323. ;Max. y-val =  1.63840E+04
  1324. ;Startvalue = min
  1325. ;Length     = 1024
  1326. SinTable:    dc.w    0,101,201,302,402,503,603,704,804,904,1005,1105,1205,1306,1406,1506
  1327.     dc.w    1606,1706,1806,1906,2006,2105,2205,2305,2404,2503,2603,2702,2801,2900,2999,3098
  1328.     dc.w    3196,3295,3393,3492,3590,3688,3786,3883,3981,4078,4176,4273,4370,4467,4563,4660
  1329.     dc.w    4756,4852,4948,5044,5139,5235,5330,5425,5520,5614,5708,5803,5897,5990,6084,6177
  1330.     dc.w    6270,6363,6455,6547,6639,6731,6823,6914,7005,7096,7186,7276,7366,7456,7545,7635
  1331.     dc.w    7723,7812,7900,7988,8076,8163,8250,8337,8423,8509,8595,8680,8765,8850,8935,9019
  1332.     dc.w    9102,9186,9269,9352,9434,9516,9598,9679,9760,9841,9921,10001,10080,10159,10238,10316
  1333.     dc.w    10394,10471,10549,10625,10702,10778,10853,10928,11003,11077,11151,11224,11297,11370,11442,11514
  1334.     dc.w    11585,11656,11727,11797,11866,11935,12004,12072,12140,12207,12274,12340,12406,12472,12537,12601
  1335.     dc.w    12665,12729,12792,12854,12916,12978,13039,13100,13160,13219,13279,13337,13395,13453,13510,13567
  1336.     dc.w    13623,13678,13733,13788,13842,13896,13949,14001,14053,14104,14155,14206,14256,14305,14354,14402
  1337.     dc.w    14449,14497,14543,14589,14635,14680,14724,14768,14811,14854,14896,14937,14978,15019,15059,15098
  1338.     dc.w    15137,15175,15213,15250,15286,15322,15357,15392,15426,15460,15493,15525,15557,15588,15619,15649
  1339.     dc.w    15679,15707,15736,15763,15791,15817,15843,15868,15893,15917,15941,15964,15986,16008,16029,16049
  1340.     dc.w    16069,16088,16107,16125,16143,16160,16176,16192,16207,16221,16235,16248,16261,16273,16284,16295
  1341.     dc.w    16305,16315,16324,16332,16340,16347,16353,16359,16364,16369,16373,16376,16379,16381,16383,16384
  1342. CosTable:    dc.w    16384,16384,16383,16381,16379,16376,16373,16369,16364,16359,16353,16347,16340,16332,16324,16315
  1343.     dc.w    16305,16295,16284,16273,16261,16248,16235,16221,16207,16192,16176,16160,16143,16125,16107,16088
  1344.     dc.w    16069,16049,16029,16008,15986,15964,15941,15917,15893,15868,15843,15817,15791,15763,15736,15707
  1345.     dc.w    15679,15649,15619,15588,15557,15525,15493,15460,15426,15392,15357,15322,15286,15250,15213,15175
  1346.     dc.w    15137,15098,15059,15019,14978,14937,14896,14854,14811,14768,14724,14680,14635,14589,14543,14497
  1347.     dc.w    14449,14402,14354,14305,14256,14206,14155,14104,14053,14001,13949,13896,13842,13788,13733,13678
  1348.     dc.w    13623,13567,13510,13453,13395,13337,13279,13219,13160,13100,13039,12978,12916,12854,12792,12729
  1349.     dc.w    12665,12601,12537,12472,12406,12340,12274,12207,12140,12072,12004,11935,11866,11797,11727,11656
  1350.     dc.w    11585,11514,11442,11370,11297,11224,11151,11077,11003,10928,10853,10778,10702,10625,10549,10471
  1351.     dc.w    10394,10316,10238,10159,10080,10001,9921,9841,9760,9679,9598,9516,9434,9352,9269,9186
  1352.     dc.w    9102,9019,8935,8850,8765,8680,8595,8509,8423,8337,8250,8163,8076,7988,7900,7812
  1353.     dc.w    7723,7635,7545,7456,7366,7276,7186,7096,7005,6914,6823,6731,6639,6547,6455,6363
  1354.     dc.w    6270,6177,6084,5990,5897,5803,5708,5614,5520,5425,5330,5235,5139,5044,4948,4852
  1355.     dc.w    4756,4660,4563,4467,4370,4273,4176,4078,3981,3883,3786,3688,3590,3492,3393,3295
  1356.     dc.w    3196,3098,2999,2900,2801,2702,2603,2503,2404,2305,2205,2105,2006,1906,1806,1706
  1357.     dc.w    1606,1506,1406,1306,1205,1105,1005,904,804,704,603,503,402,302,201,101
  1358.     dc.w    0,-101,-201,-302,-402,-503,-603,-703,-804,-904,-1005,-1105,-1205,-1306,-1406,-1506
  1359.     dc.w    -1606,-1706,-1806,-1906,-2006,-2105,-2205,-2305,-2404,-2503,-2603,-2702,-2801,-2900,-2999,-3098
  1360.     dc.w    -3196,-3295,-3393,-3492,-3590,-3688,-3786,-3883,-3981,-4078,-4176,-4273,-4370,-4467,-4563,-4660
  1361.     dc.w    -4756,-4852,-4948,-5044,-5139,-5235,-5330,-5425,-5520,-5614,-5708,-5803,-5897,-5990,-6084,-6177
  1362.     dc.w    -6270,-6363,-6455,-6547,-6639,-6731,-6823,-6914,-7005,-7096,-7186,-7276,-7366,-7456,-7545,-7635
  1363.     dc.w    -7723,-7812,-7900,-7988,-8076,-8163,-8250,-8337,-8423,-8509,-8595,-8680,-8765,-8850,-8935,-9019
  1364.     dc.w    -9102,-9186,-9269,-9352,-9434,-9516,-9598,-9679,-9760,-9840,-9921,-10001,-10080,-10159,-10238,-10316
  1365.     dc.w    -10394,-10471,-10549,-10625,-10702,-10778,-10853,-10928,-11003,-11077,-11151,-11224,-11297,-11370,-11442,-11514
  1366.     dc.w    -11585,-11656,-11727,-11797,-11866,-11935,-12004,-12072,-12140,-12207,-12274,-12340,-12406,-12472,-12537,-12601
  1367.     dc.w    -12665,-12729,-12792,-12854,-12916,-12978,-13039,-13100,-13160,-13219,-13279,-13337,-13395,-13453,-13510,-13567
  1368.     dc.w    -13623,-13678,-13733,-13788,-13842,-13896,-13949,-14001,-14053,-14104,-14155,-14206,-14256,-14305,-14354,-14402
  1369.     dc.w    -14449,-14497,-14543,-14589,-14635,-14680,-14724,-14768,-14811,-14854,-14896,-14937,-14978,-15019,-15059,-15098
  1370.     dc.w    -15137,-15175,-15213,-15250,-15286,-15322,-15357,-15392,-15426,-15460,-15493,-15525,-15557,-15588,-15619,-15649
  1371.     dc.w    -15679,-15707,-15736,-15763,-15791,-15817,-15843,-15868,-15893,-15917,-15941,-15964,-15986,-16008,-16029,-16049
  1372.     dc.w    -16069,-16088,-16107,-16125,-16143,-16160,-16176,-16192,-16207,-16221,-16235,-16248,-16261,-16273,-16284,-16295
  1373.     dc.w    -16305,-16315,-16324,-16332,-16340,-16347,-16353,-16359,-16364,-16369,-16373,-16376,-16379,-16381,-16383,-16384
  1374.     dc.w    -16384,-16384,-16383,-16381,-16379,-16376,-16373,-16369,-16364,-16359,-16353,-16347,-16340,-16332,-16324,-16315
  1375.     dc.w    -16305,-16295,-16284,-16273,-16261,-16248,-16235,-16221,-16207,-16192,-16176,-16160,-16143,-16125,-16107,-16088
  1376.     dc.w    -16069,-16049,-16029,-16008,-15986,-15964,-15941,-15917,-15893,-15868,-15843,-15817,-15791,-15763,-15736,-15707
  1377.     dc.w    -15679,-15649,-15619,-15588,-15557,-15525,-15493,-15460,-15426,-15392,-15357,-15322,-15286,-15250,-15213,-15175
  1378.     dc.w    -15137,-15098,-15059,-15019,-14978,-14937,-14896,-14854,-14811,-14768,-14724,-14680,-14635,-14589,-14543,-14497
  1379.     dc.w    -14449,-14402,-14354,-14305,-14256,-14206,-14155,-14104,-14053,-14001,-13949,-13896,-13842,-13788,-13733,-13678
  1380.     dc.w    -13623,-13567,-13510,-13453,-13395,-13337,-13279,-13219,-13160,-13100,-13039,-12978,-12916,-12854,-12792,-12729
  1381.     dc.w    -12665,-12601,-12537,-12472,-12406,-12340,-12274,-12207,-12140,-12072,-12004,-11935,-11866,-11797,-11727,-11656
  1382.     dc.w    -11585,-11514,-11442,-11370,-11297,-11224,-11151,-11077,-11003,-10928,-10853,-10778,-10702,-10625,-10549,-10471
  1383.     dc.w    -10394,-10316,-10238,-10159,-10080,-10001,-9921,-9841,-9760,-9679,-9598,-9516,-9434,-9352,-9269,-9186
  1384.     dc.w    -9102,-9019,-8935,-8850,-8765,-8680,-8595,-8509,-8423,-8337,-8250,-8163,-8076,-7988,-7900,-7812
  1385.     dc.w    -7723,-7635,-7545,-7456,-7366,-7277,-7186,-7096,-7005,-6914,-6823,-6731,-6639,-6547,-6455,-6363
  1386.     dc.w    -6270,-6177,-6084,-5990,-5897,-5803,-5708,-5614,-5520,-5425,-5330,-5235,-5139,-5044,-4948,-4852
  1387.     dc.w    -4756,-4660,-4563,-4467,-4370,-4273,-4176,-4078,-3981,-3883,-3786,-3688,-3590,-3492,-3393,-3295
  1388.     dc.w    -3196,-3098,-2999,-2900,-2801,-2702,-2603,-2503,-2404,-2305,-2205,-2105,-2006,-1906,-1806,-1706
  1389.     dc.w    -1606,-1506,-1406,-1306,-1205,-1105,-1005,-904,-804,-704,-603,-503,-402,-302,-201,-101
  1390.     dc.w    0,101,201,302,402,503,603,704,804,904,1005,1105,1205,1306,1406,1506
  1391.     dc.w    1606,1706,1806,1906,2006,2105,2205,2305,2404,2503,2603,2702,2801,2900,2999,3098
  1392.     dc.w    3196,3295,3393,3492,3590,3688,3786,3883,3981,4078,4176,4273,4370,4467,4563,4660
  1393.     dc.w    4756,4852,4948,5044,5139,5235,5330,5425,5520,5614,5708,5803,5897,5990,6084,6177
  1394.     dc.w    6270,6363,6455,6547,6639,6731,6823,6914,7005,7096,7186,7276,7366,7456,7545,7635
  1395.     dc.w    7723,7812,7900,7988,8076,8163,8250,8337,8423,8509,8595,8680,8765,8850,8935,9019
  1396.     dc.w    9102,9186,9269,9352,9434,9516,9598,9679,9760,9841,9921,10001,10080,10159,10238,10316
  1397.     dc.w    10394,10471,10549,10625,10702,10778,10853,10928,11003,11077,11151,11224,11297,11370,11442,11514
  1398.     dc.w    11585,11656,11727,11797,11866,11935,12004,12072,12140,12207,12274,12340,12406,12472,12537,12601
  1399.     dc.w    12665,12729,12792,12854,12916,12978,13039,13100,13160,13219,13279,13337,13395,13453,13510,13567
  1400.     dc.w    13623,13678,13733,13788,13842,13896,13949,14001,14053,14104,14155,14206,14256,14305,14354,14402
  1401.     dc.w    14449,14497,14543,14589,14635,14680,14724,14768,14811,14854,14896,14937,14978,15019,15059,15098
  1402.     dc.w    15137,15175,15213,15250,15286,15322,15357,15392,15426,15460,15493,15525,15557,15588,15619,15649
  1403.     dc.w    15679,15707,15736,15763,15791,15817,15843,15868,15893,15917,15941,15964,15986,16008,16029,16049
  1404.     dc.w    16069,16088,16107,16125,16143,16160,16176,16192,16207,16221,16235,16248,16261,16273,16284,16295
  1405.     dc.w    16305,16315,16324,16332,16340,16347,16353,16359,16364,16369,16373,16376,16379,16381,16383,16384
  1406.  
  1407.  
  1408.  
  1409.  
  1410.     SECTION    VariableTing,bss
  1411.  
  1412.     CNOP    0,4
  1413. _Bss2Start:
  1414. MaxRast:    ds.w    1
  1415. VBlank:    ds.b    1
  1416.     IFEQ    Track-0
  1417. IWantOut:    ds.b    1
  1418.     ELSE
  1419.     ds.b    1
  1420. IWantOut:    EQU    $80
  1421.     ENDC
  1422. CodeBuffer:    ds.b    320*8*(MatrixSize*BytesPerDot+2)
  1423. CodeMulsTab:    ds.l    320*8
  1424. _CodeBufferEnd:
  1425. VerticalBuffer:    ds.w    256*2*MatrixSize
  1426. VerticalMulsTab:    ds.l    256*2
  1427. _VerticalBufferEnd:
  1428. InterpolBuffer:    ds.w    320*MatrixSize*2
  1429. _InterpolBufferEnd:
  1430. PerspCoords:    ds.w    2*8
  1431. SideBuffer1:    ds.w    MatrixSize*2
  1432. SideBuffer2:    ds.w    MatrixSize*2
  1433. FaceBuffer1:    ds.w    MatrixSize*MatrixSize*2
  1434. FaceBuffer2:    ds.w    MatrixSize*MatrixSize*2
  1435. ColorArray:    ds.l    256
  1436. TransTrin:    ds.w    1
  1437. TransPause:    ds.w    1
  1438. Story:    ds.w    1
  1439.     CNOP    0,4
  1440. _Bss2End:
  1441.  
  1442.  
  1443.  
  1444.  
  1445. *******************************************************************************
  1446. **
  1447. **  Og den vildeste copperliste...
  1448. **
  1449. *******************************************************************************
  1450.     SECTION    MyCopper,data_c
  1451.  
  1452. FadeCopper:    dc.w    Bplcon0,$0201
  1453.     dc.w    $1001,$fffe
  1454. .col    dc.w    Color00,0
  1455.     dc.l    -2
  1456.  
  1457. Copper:    dc.w    $1001,$fffe
  1458.     dc.w    Bplcon0,$0201
  1459.     dc.w    Bplcon1,$0000
  1460.     dc.w    Bplcon2,$0024
  1461.     IFEQ    ECS-0
  1462.     dc.w    Bplcon3,$0c40
  1463.     dc.w    $01e4,$0000
  1464.     dc.w    $01fc,$0003
  1465.     ENDC
  1466.  
  1467.     dc.w    Spr0pth,0,Spr0ptl,0
  1468.     dc.w    Spr1pth,0,Spr1ptl,0
  1469.     dc.w    Spr2pth,0,Spr2ptl,0
  1470.     dc.w    Spr3pth,0,Spr3ptl,0
  1471.     dc.w    Spr4pth,0,Spr4ptl,0
  1472.     dc.w    Spr5pth,0,Spr5ptl,0
  1473.     dc.w    Spr6pth,0,Spr6ptl,0
  1474.     dc.w    Spr7pth,0,Spr7ptl,0
  1475.  
  1476. AGA_Colors:    IFEQ    ECS-1
  1477.     blk.l    32,0
  1478.     ELSE
  1479.     blk.l    33*8*2,0
  1480.     ENDC
  1481.  
  1482.     dc.w    $1801,$fffe
  1483. Copper_PlanePtr:    dc.w    Bpl1pth,0,Bpl1ptl,0
  1484.     dc.w    Bpl2pth,0,Bpl2ptl,0
  1485.     dc.w    Bpl3pth,0,Bpl3ptl,0
  1486.     dc.w    Bpl4pth,0,Bpl4ptl,0
  1487.     dc.w    Bpl5pth,0,Bpl5ptl,0
  1488.     IFEQ    ECS-0
  1489.     dc.w    Bpl6pth,0,Bpl6ptl,0
  1490.     dc.w    Bpl7pth,0,Bpl7ptl,0
  1491.     dc.w    Bpl8pth,0,Bpl8ptl,0
  1492.     ENDC
  1493.  
  1494.     IFEQ    ECS-0
  1495.     dc.w    $010c,$0011
  1496.     dc.w    Bplcon3,$0c40
  1497.     ENDC
  1498.     dc.w    Bplcon2,$0224
  1499.     dc.w    Ddfstrt,$0038
  1500.     dc.w    Ddfstop,$00d0
  1501.     dc.w    Diwstrt,$3081
  1502.     dc.w    Diwstop,$30c1
  1503.     dc.w    Bplcon1,$0000
  1504.     IFEQ    ECS-1
  1505.     dc.w    Bpl1mod,40
  1506.     dc.w    Bpl2mod,40
  1507.     ELSE
  1508.     dc.w    Bpl1mod,40-8
  1509.     dc.w    Bpl2mod,40-8
  1510.     ENDC
  1511.  
  1512.     dc.w    $2f01,$fffe
  1513.     IFEQ    ECS-1
  1514.     dc.w    Bplcon0,$5200
  1515.     ELSE
  1516.     dc.w    Bplcon0,$0210
  1517.     ENDC
  1518.  
  1519.     dc.w    $106,$c40
  1520.  
  1521. CirkelLine:    EQU    $91
  1522.  
  1523. Cirkel1:    MACRO
  1524.     IFEQ    (CirkelLine+\1)-$100
  1525.     IFEQ    ECS-0
  1526.     dc.w    $ffd9,$fffe
  1527.     ELSE
  1528.     dc.w    $ffe1,$fffe
  1529.     ENDC
  1530.     ENDC
  1531.     IF    ((CirkelLine+\1)>$12f)&(ECS-1)
  1532.     dc.w    ((CirkelLine+\1)&$ff)<<8!$91,$fffe
  1533.     dc.w    Color00,$103
  1534.     dc.w    ((CirkelLine+\1)&$ff)<<8!$c9,$fffe
  1535.     ELSE
  1536.     dc.w    ((CirkelLine+\1)&$ff)<<8!$93,$fffe
  1537.     dc.w    Color00,$103
  1538.     dc.w    ((CirkelLine+\1)&$ff)<<8!$cb,$fffe
  1539.     ENDC
  1540.     dc.w    Color00,$103
  1541.     ENDM
  1542.  
  1543. CirkelTing:    MACRO
  1544.     Cirkel1    \1+0
  1545.     Cirkel1    \1+1
  1546.     Cirkel1    \1+2
  1547.     Cirkel1    \1+3
  1548.     Cirkel1    \1+4
  1549.     Cirkel1    \1+5
  1550.     Cirkel1    \1+6
  1551.     Cirkel1    \1+7
  1552.     ENDM
  1553.  
  1554.     CirkelTing    0
  1555.     CirkelTing    8
  1556.     CirkelTing    8*2
  1557.     CirkelTing    8*3
  1558.     CirkelTing    8*4
  1559.     CirkelTing    8*5
  1560.     CirkelTing    8*6
  1561.     CirkelTing    8*7
  1562.     CirkelTing    8*8
  1563.     CirkelTing    8*9
  1564.     CirkelTing    8*10
  1565.     CirkelTing    8*11
  1566.     CirkelTing    8*12
  1567.     CirkelTing    8*13
  1568.     CirkelTing    8*14
  1569.     CirkelTing    8*15
  1570.     CirkelTing    8*16
  1571.     CirkelTing    8*17
  1572.     CirkelTing    8*18
  1573.     CirkelTing    8*19
  1574.     CirkelTing    8*20
  1575. DezignJohn:
  1576.  
  1577.  
  1578.     dc.l    -2
  1579.     dc.l    -2
  1580.  
  1581.  
  1582.  
  1583.  
  1584. *******************************************************************************
  1585. **
  1586. **  Screens+Gfx
  1587. **
  1588. *******************************************************************************
  1589.     SECTION    Screens,bss_c
  1590.  
  1591.     CNOP    0,8
  1592. _Bss1Start:
  1593. Screen1:    ds.b    256*80
  1594. Screen2:    ds.b    256*80
  1595. Screen3:    ds.b    256*80
  1596. Screen4:    ds.b    256*80
  1597. Screen5:    ds.b    256*80
  1598. Screen6:    ds.b    256*80
  1599. Screen7:    ds.b    256*80
  1600.     IFEQ    ECS-0
  1601. Screen8:    ds.b    256*80
  1602. Screen9:    ds.b    256*80
  1603. Screen10:    ds.b    256*80
  1604.     ENDC
  1605.     CNOP    0,4
  1606. _Bss1End:
  1607.  
  1608.  
  1609.  
  1610.  
  1611. *******************************************************************************
  1612. **
  1613. **  Print info on program
  1614. **
  1615. *******************************************************************************
  1616.  
  1617.     PRINTT    '          '
  1618.     PRINTT    'Code buffer size:'
  1619.     PRINTV    _CodeBufferEnd-CodeBuffer
  1620.     PRINTT    'Vertical buffer size:'
  1621.     PRINTV    _VerticalBufferEnd-VerticalBuffer
  1622.     PRINTT    'Interpol buffer size:'
  1623.     PRINTV    _InterpolBufferEnd-InterpolBuffer
  1624.     PRINTT    'Buffers ialt'
  1625.     PRINTV    _InterpolBufferEnd-InterpolBuffer+_CodeBufferEnd-CodeBuffer+_VerticalBufferEnd-VerticalBuffer
  1626.     PRINTT
  1627.     PRINTT    'Bitplaner:'
  1628.     PRINTV    _Bss1End-_Bss1Start
  1629.     PRINTT
  1630.     PRINTT    'MatrixSize:'
  1631.     PRINTV    MatrixSize
  1632.     PRINTT    'Dots ialt:'
  1633.     PRINTV    MatrixSize*MatrixSize*MatrixSize
  1634.  
  1635.  
  1636. *******************************************************************************
  1637. **
  1638. **  Hardware registers
  1639. **
  1640. *******************************************************************************
  1641. Bltddat:    EQU    $000
  1642. Dmaconr:    EQU    $002
  1643. Vposr:    EQU    $004
  1644. Vhposr:    EQU    $006
  1645. Dskdatr:    EQU    $008
  1646. Joy0dat:    EQU    $00a
  1647. Joy1dat:    EQU    $00c
  1648. Clxdat:    EQU    $00e
  1649. Adkconr:    EQU    $010
  1650. Pot0dat:    EQU    $012
  1651. Pot1dat:    EQU    $014
  1652. Potgor:    EQU    $016
  1653. Serdatr:    EQU    $018
  1654. Dskbytr:    EQU    $01a
  1655. Intenar:    EQU    $01c
  1656. Intreqr:    EQU    $01e
  1657. Dskpth:    EQU    $020
  1658. Dskptl:    EQU    $022
  1659. Dsklen:    EQU    $024
  1660. Dskdat:    EQU    $026
  1661. Refptr:    EQU    $028
  1662. Vposw:    EQU    $02a
  1663. Vhposw:    EQU    $02c
  1664. Copcon:    EQU    $02e
  1665. Serdat:    EQU    $030
  1666. Serper:    EQU    $032
  1667. Potgo:    EQU    $034
  1668. Joytest:    EQU    $036
  1669. Strequ:    EQU    $038
  1670. Strvbl:    EQU    $03a
  1671. Strhor:    EQU    $03c
  1672. Strlong:    EQU    $03e
  1673. Bltcon0:    EQU    $040
  1674. Bltcon1:    EQU    $042
  1675. Bltafwm:    EQU    $044
  1676. Bltalwm:    EQU    $046
  1677. Bltcpth:    EQU    $048
  1678. Bltcptl:    EQU    $04a
  1679. Bltbpth:    EQU    $04c
  1680. Bltbptl:    EQU    $04e
  1681. Bltapth:    EQU    $050
  1682. Bltaptl:    EQU    $052
  1683. Bltdpth:    EQU    $054
  1684. Bltdptl:    EQU    $056
  1685. Bltsize:    EQU    $058
  1686. Bltsizv:    EQU    $05c
  1687. Bltsizh:    EQU    $05e
  1688. Bltcmod:    EQU    $060
  1689. Bltbmod:    EQU    $062
  1690. Bltamod:    EQU    $064
  1691. Bltdmod:    EQU    $066
  1692. Bltcdat:    EQU    $070
  1693. Bltbdat:    EQU    $072
  1694. Bltadat:    EQU    $074
  1695. Dsksync:    EQU    $07e
  1696. Cop1lch:    EQU    $080
  1697. Cop1lcl:    EQU    $082
  1698. Cop2lch:    EQU    $084
  1699. Cop2lcl:    EQU    $086
  1700. Copjmp1:    EQU    $088
  1701. Copjmp2:    EQU    $08a
  1702. Copins:    EQU    $08c
  1703. Diwstrt:    EQU    $08e
  1704. Diwstop:    EQU    $090
  1705. Ddfstrt:    EQU    $092
  1706. Ddfstop:    EQU    $094
  1707. Dmacon:    EQU    $096
  1708. Clxcon:    EQU    $98
  1709. Intena:    EQU    $09a
  1710. Intreq:    EQU    $09c
  1711. Adkcon:    EQU    $09e
  1712. Aud0dat:    EQU    $0aa
  1713. Aud1dat:    EQU    $0ba
  1714. Aud2dat:    EQU    $0ca
  1715. Aud3dat:    EQU    $0da
  1716. Aud0lch:    EQU    $0a0
  1717. Aud1lch:    EQU    $0b0
  1718. Aud2lch:    EQU    $0c0
  1719. Aud3lch:    EQU    $0d0
  1720. Aud0len:    EQU    $0a4
  1721. Aud1len:    EQU    $0b4
  1722. Aud2len:    EQU    $0c4
  1723. Aud3len:    EQU    $0d4
  1724. Aud0per:    EQU    $0a6
  1725. Aud1per:    EQU    $0b6
  1726. Aud2per:    EQU    $0c6
  1727. Aud3per:    EQU    $0d6
  1728. Aud0vol:    EQU    $0a8
  1729. Aud1vol:    EQU    $0b8
  1730. Aud2vol:    EQU    $0c8
  1731. Aud3vol:    EQU    $0d8
  1732. Aud0lcl:    EQU    $0a2
  1733. Aud1lcl:    EQU    $0b2
  1734. Aud2lcl:    EQU    $0c2
  1735. Aud3lcl:    EQU    $0d2
  1736. Bpl1pth:    EQU    $0e0
  1737. Bpl1ptl:    EQU    $0e2
  1738. Bpl2pth:    EQU    $0e4
  1739. Bpl2ptl:    EQU    $0e6
  1740. Bpl3pth:    EQU    $0e8
  1741. Bpl3ptl:    EQU    $0ea
  1742. Bpl4pth:    EQU    $0ec
  1743. Bpl4ptl:    EQU    $0ee
  1744. Bpl5pth:    EQU    $0f0
  1745. Bpl5ptl:    EQU    $0f2
  1746. Bpl6pth:    EQU    $0f4
  1747. Bpl6ptl:    EQU    $0f6
  1748. Bpl7pth:    EQU    $0f8
  1749. Bpl7ptl:    EQU    $0fa
  1750. Bpl8pth:    EQU    $0fc
  1751. Bpl8ptl:    EQU    $0fe
  1752. Bplcon0:    EQU    $100
  1753. Bplcon1:    EQU    $102
  1754. Bplcon2:    EQU    $104
  1755. Bplcon3:    EQU    $106
  1756. Bpl1mod:    EQU    $108
  1757. Bpl2mod:    EQU    $10a
  1758. Bpl1dat:    EQU    $110
  1759. Bpl2dat:    EQU    $112
  1760. Bpl3dat:    EQU    $114
  1761. Bpl4dat:    EQU    $116
  1762. Bpl5dat:    EQU    $118
  1763. Bpl6dat:    EQU    $11a
  1764. Spr0pth:    EQU    $120
  1765. Spr0ptl:    EQU    $122
  1766. Spr1pth:    EQU    $124
  1767. Spr1ptl:    EQU    $126
  1768. Spr2pth:    EQU    $128
  1769. Spr2ptl:    EQU    $12a
  1770. Spr3pth:    EQU    $12c
  1771. Spr3ptl:    EQU    $12e
  1772. Spr4pth:    EQU    $130
  1773. Spr4ptl:    EQU    $132
  1774. Spr5pth:    EQU    $134
  1775. Spr5ptl:    EQU    $136
  1776. Spr6pth:    EQU    $138
  1777. Spr6ptl:    EQU    $13a
  1778. Spr7pth:    EQU    $13c
  1779. Spr7ptl:    EQU    $13e
  1780. Spr0pos:    EQU    $140
  1781. Spr0ctl:    EQU    $142
  1782. Spr0data:    EQU    $144
  1783. Spr0datb:    EQU    $146
  1784. Spr1pos:    EQU    $148
  1785. Spr1ctl:    EQU    $14a
  1786. Spr1data:    EQU    $14c
  1787. Spr1datb:    EQU    $14e
  1788. Spr2pos:    EQU    $150
  1789. Spr2ctl:    EQU    $152
  1790. Spr2data:    EQU    $154
  1791. Spr2datb:    EQU    $156
  1792. Spr3pos:    EQU    $158
  1793. Spr3ctl:    EQU    $15a
  1794. Spr3data:    EQU    $15c
  1795. Spr3datb:    EQU    $15e
  1796. Spr4pos:    EQU    $160
  1797. Spr4ctl:    EQU    $162
  1798. Spr4data:    EQU    $164
  1799. Spr4datb:    EQU    $166
  1800. Spr5pos:    EQU    $168
  1801. Spr5ctl:    EQU    $16a
  1802. Spr5data:    EQU    $16c
  1803. Spr5datb:    EQU    $16e
  1804. Spr6pos:    EQU    $170
  1805. Spr6ctl:    EQU    $172
  1806. Spr6data:    EQU    $174
  1807. Spr6datb:    EQU    $176
  1808. Spr7pos:    EQU    $178
  1809. Spr7ctl:    EQU    $17a
  1810. Spr7data:    EQU    $17c
  1811. Spr7datb:    EQU    $17e
  1812. Color00:    EQU    $180
  1813. Color01:    EQU    $182
  1814. Color02:    EQU    $184
  1815. Color03:    EQU    $186
  1816. Color04:    EQU    $188
  1817. Color05:    EQU    $18a
  1818. Color06:    EQU    $18c
  1819. Color07:    EQU    $18e
  1820. Color08:    EQU    $190
  1821. Color09:    EQU    $192
  1822. Color10:    EQU    $194
  1823. Color11:    EQU    $196
  1824. Color12:    EQU    $198
  1825. Color13:    EQU    $19a
  1826. Color14:    EQU    $19c
  1827. Color15:    EQU    $19e
  1828. Color16:    EQU    $1a0
  1829. Color17:    EQU    $1a2
  1830. Color18:    EQU    $1a4
  1831. Color19:    EQU    $1a6
  1832. Color20:    EQU    $1a8
  1833. Color21:    EQU    $1aa
  1834. Color22:    EQU    $1ac
  1835. Color23:    EQU    $1ae
  1836. Color24:    EQU    $1b0
  1837. Color25:    EQU    $1b2
  1838. Color26:    EQU    $1b4
  1839. Color27:    EQU    $1b6
  1840. Color28:    EQU    $1b8
  1841. Color29:    EQU    $1ba
  1842. Color30:    EQU    $1bc
  1843. Color31:    EQU    $1be
  1844. _Custom:    EQU    $dff000
  1845.  
  1846.  
  1847.  
  1848.  
  1849. *******************************************************************************
  1850. **
  1851. **  Interrupt addresses
  1852. **
  1853. *******************************************************************************
  1854. Lev1Base:    EQU    $64
  1855. Lev2Base:    EQU    $68
  1856. Lev3Base:    EQU    $6c
  1857. Lev4Base:    EQU    $70
  1858. Lev5Base:    EQU    $74
  1859. Lev6Base:    EQU    $78
  1860. Lev7Base:    EQU    $7c
  1861. Trap0:    EQU    $80
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.